package me.zhengjie.modules.workorder.domain;

import lombok.Data;
import javax.persistence.*;

import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.io.Serializable;

/**
* @author zcw
* @date 2019-08-10
*/
@Entity
@Data
@Table(name="t_accident")
@DynamicUpdate
public class TAccident implements Serializable {

	private static final long serialVersionUID = -1597503624173660646L;

	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    // 客户标识
    @Column(name = "customer_id")
    private Long customerId;

    // 客户名称
    @Column(name = "customer_name",nullable = false)
    private String customerName;

    // 报修设备
    @Column(name = "fault_device",nullable = false)
    private String faultDevice;
    
    // 故障描述
    @Column(name = "fault_desc",nullable = false)
    private String faultDesc;

    // 故障图片
    @Column(name = "fault_picture")
    private String faultPicture;

    // 要求到场时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ,  timezone="GMT+8")
    @Column(name = "reqiure_time")
    private Date reqiureTime;

    // 客户地址
    @Column(name = "address")
    private String address;

    // 备注
    @Column(name = "notes")
    private String notes;

    // 联系人
    @Column(name = "linker",nullable = false)
    private String linker;

    // 联系人手机号码
    @Column(name = "cellphone",nullable = false)
    private String cellphone;

    // 录入人
    @Column(name = "input_operator",nullable = false)
    private String inputOperator;

    // 录入时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",  timezone="GMT+8")
    @Column(name = "input_time",nullable = false)
    private Date inputTime;

    // 报修时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",  timezone="GMT+8")
    @Column(name = "report_time",nullable = false)
    private Date reportTime;

    // 来源 1.客户app报修 2.工程师代报 3.操作人员录入
    @Column(name = "source",nullable = false)
    private Integer source;

    // 状态
    @Column(name = "state",nullable = false)
    private Integer state;

    @Column(name = "country")
    private String country;

    @Column(name = "province")
    private String province;

    @Column(name = "city")
    private String city;

    @Column(name = "county")
    private String county;
}